package com.tupu.entity.dispatch;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * 
 * @TableName tb_signalfrequency_level
 */
@TableName(value ="tb_signalfrequency_level")
@Data
public class SignalfrequencyLevel implements Serializable {
    /**
     * 
     */
    @TableId(value = "id")
    private Integer id;

    /**
     * 
     */
    @TableField(value = "level")
    private String level;

    /**
     * 
     */
    @TableField(value = "type")
    private String type;

    /**
     * 
     */
    @TableField(value = "frequency_level")
    private String frequencyLevel;

    /**
     * 
     */
    @TableField(value = "key_words")
    private String keyWords;

    /**
     * 
     */
    @TableField(value = "delay_alarm")
    private Integer delayAlarm;

    /**
     * 
     */
    @TableField(value = "suppression_alarm")
    private Integer suppressionAlarm;

    /**
     * 
     */
    @TableField(value = "remark")
    private String remark;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public String getSolveWay() {
        String result = "";
        if (this.delayAlarm != null && this.delayAlarm == 1) {
            result = result + "延时告警";
        }
        if (suppressionAlarm != null && suppressionAlarm == 1) {
            result = result + (StringUtils.isNotEmpty(result) ? "/" : "") + "抑制告警";
        }
        return result;
    }
}